// source --> http://www.wensleydalelodge.co.za/wp-content/plugins/nextgen-gallery/shutter/shutter-reloaded.js?ver=1.3.0 /* Shutter Reloaded for NextGEN Gallery http://www.laptoptips.ca/javascripts/shutter-reloaded/ Version: 1.3.0 Copyright (C) 2007-2008 Andrew Ozz Released under the GPL, http://www.gnu.org/copyleft/gpl.html Acknowledgement: some ideas are from: Shutter by Andrew Sutherland - http://code.jalenack.com, WordPress - http://wordpress.org, Lightbox by Lokesh Dhakar - http://www.huddletogether.com, the icons are from Crystal Project Icons, Everaldo Coelho, http://www.everaldo.com */ shutterOnload = function(){shutterReloaded.init('sh');} if (typeof shutterOnload == 'function') { if ('undefined' != typeof jQuery) jQuery(document).ready(function(){shutterOnload();}); else if( typeof window.onload != 'function' ) window.onload = shutterOnload; else {oldonld = window.onload;window.onload = function(){if(oldonld){oldonld();};shutterOnload();}}; } shutterReloaded = { I : function (a) { return document.getElementById(a); }, settings : function() { var t = this, s = shutterSettings; t.imageCount = s.imageCount || 0; //t.msgLoading = s.msgLoading || 'L O A D I N G'; t.msgLoading = s.msgLoading || ' '; t.msgClose = s.msgClose || 'Click to Close'; }, init : function (a) { var t = this, L, T, ext, i, m, setid, inset, shfile, shMenuPre, k, img; shutterLinks = {}, shutterSets = {}; if ( 'object' != typeof shutterSettings ) shutterSettings = {}; for ( i = 0; i < document.links.length; i++ ) { L = document.links[i]; ext = ( L.href.indexOf('?') == -1 ) ? L.href.slice(-4).toLowerCase() : L.href.substring( 0, L.href.indexOf('?') ).slice(-4).toLowerCase(); if ( ext != '.jpg' && ext != '.png' && ext != '.gif' && ext != 'jpeg' ) continue; if ( a == 'sh' && L.className.toLowerCase().indexOf('shutter') == -1 ) continue; if ( a == 'lb' && L.rel.toLowerCase().indexOf('lightbox') == -1 ) continue; if ( L.className.toLowerCase().indexOf('shutterset') != -1 ) setid = L.className.replace(/\s/g, '_'); else if ( L.rel.toLowerCase().indexOf('lightbox[') != -1 ) setid = L.rel.replace(/\s/g, '_'); else setid = 0, inset = -1; if( setid ) { if ( ! shutterSets[setid] ) shutterSets[setid] = []; inset = shutterSets[setid].push(i); } shfile = L.href.slice(L.href.lastIndexOf('/')+1); T = ( L.title && L.title != shfile ) ? L.title : ''; shutterLinks[i] = {link:L.href,num:inset,set:setid,title:T} L.onclick = new Function('shutterReloaded.make("' + i + '");return false;'); } t.settings(); }, make : function(ln,fs) { var t = this, prev, next, prevlink = '', nextlink = '', previmg, nextimg, D, S, W, fsarg = -1, imgNum, NavBar; if ( ! t.Top ) { if ( typeof window.pageYOffset != 'undefined' ) t.Top = window.pageYOffset; else t.Top = (document.documentElement.scrollTop > 0) ? document.documentElement.scrollTop : document.body.scrollTop; } if ( typeof t.pgHeight == 'undefined' ) t.pgHeight = Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); if ( fs ) t.FS = ( fs > 0 ) ? 1 : 0; else t.FS = shutterSettings.FS || 0; if ( t.resizing ) t.resizing = null; window.onresize = new Function('shutterReloaded.resize("'+ln+'");'); document.documentElement.style.overflowX = 'hidden'; if ( ! t.VP ) { t._viewPort(); t.VP = true; } if ( ! (S = t.I('shShutter')) ) { S = document.createElement('div'); S.setAttribute('id','shShutter'); document.getElementsByTagName('body')[0].appendChild(S); t.hideTags(); } if ( ! (D = t.I('shDisplay')) ) { D = document.createElement('div'); D.setAttribute('id','shDisplay'); D.style.top = t.Top + 'px'; document.getElementsByTagName('body')[0].appendChild(D); } S.style.height = t.pgHeight + 'px'; var dv = t.textBtns ? ' | ' : ''; if ( shutterLinks[ln].num > 1 ) { prev = shutterSets[shutterLinks[ln].set][shutterLinks[ln].num - 2]; prevlink = '<<'+dv; previmg = new Image(); previmg.src = shutterLinks[prev].link; } else { prevlink = ''; } if ( shutterLinks[ln].num != -1 && shutterLinks[ln].num < (shutterSets[shutterLinks[ln].set].length) ) { next = shutterSets[shutterLinks[ln].set][shutterLinks[ln].num]; nextlink = '>>'+dv; nextimg = new Image(); nextimg.src = shutterLinks[next].link; } else { nextlink = ''; } imgNum = ( (shutterLinks[ln].num > 0) && t.imageCount ) ? '
 ( ' + shutterLinks[ln].num + ' / ' + shutterSets[shutterLinks[ln].set].length + ' ) 
' : ''; NavBar = '
' + prevlink + '
' + nextlink + '
' + shutterLinks[ln].title + '
' + imgNum + '
'; D.innerHTML = '
' + NavBar +'
'; window.setTimeout(function(){shutterReloaded.loading();},2000); }, loading : function() { var t = this, S, WB, W; if ( (W = t.I('shWrap')) && W.style.visibility == 'visible' ) return; if ( ! (S = t.I('shShutter')) ) return; if ( t.I('shWaitBar') ) return; WB = document.createElement('div'); WB.setAttribute('id','shWaitBar'); WB.style.top = t.Top + 'px'; WB.innerHTML = t.msgLoading; S.appendChild(WB); }, hideShutter : function() { var t = this, D, S; if ( D = t.I('shDisplay') ) D.parentNode.removeChild(D); if ( S = t.I('shShutter') ) S.parentNode.removeChild(S); t.hideTags(true); window.scrollTo(0,t.Top); window.onresize = t.FS = t.Top = t.VP = null; document.documentElement.style.overflowX = ''; }, resize : function(ln) { var t = this; if ( t.resizing ) return; if ( ! t.I('shShutter') ) return; var W = t.I('shWrap'); if ( W ) W.style.visibility = 'hidden'; window.setTimeout(function(){shutterReloaded.resizing = null},500); window.setTimeout(new Function('shutterReloaded.VP = null;shutterReloaded.make("'+ln+'");'),100); t.resizing = true; }, _viewPort : function() { var t = this; var wiH = window.innerHeight ? window.innerHeight : 0; var dbH = document.body.clientHeight ? document.body.clientHeight : 0; var deH = document.documentElement ? document.documentElement.clientHeight : 0; if( wiH > 0 ) { t.wHeight = ( (wiH - dbH) > 1 && (wiH - dbH) < 30 ) ? dbH : wiH; t.wHeight = ( (t.wHeight - deH) > 1 && (t.wHeight - deH) < 30 ) ? deH : t.wHeight; } else t.wHeight = ( deH > 0 ) ? deH : dbH; var deW = document.documentElement ? document.documentElement.clientWidth : 0; var dbW = window.innerWidth ? window.innerWidth : document.body.clientWidth; t.wWidth = ( deW > 1 ) ? deW : dbW; }, showImg : function() { var t = this, S = t.I('shShutter'), D = t.I('shDisplay'), TI = t.I('shTopImg'), T = t.I('shTitle'), NB = t.I('shNavBar'), W, WB, wHeight, wWidth, shHeight, maxHeight, itop, mtop, resized = 0; if ( ! S ) return; if ( (W = t.I('shWrap')) && W.style.visibility == 'visible' ) return; if ( WB = t.I('shWaitBar') ) WB.parentNode.removeChild(WB); S.style.width = D.style.width = ''; T.style.width = (TI.width - 4) + 'px'; shHeight = t.wHeight - 7; if ( t.FS ) { if ( TI.width > (t.wWidth - 10) ) S.style.width = D.style.width = TI.width + 10 + 'px'; document.documentElement.style.overflowX = ''; } else { window.scrollTo(0,t.Top); if ( TI.height > shHeight ) { TI.width = TI.width * (shHeight / TI.height); TI.height = shHeight; resized = 1; } if ( TI.width > (t.wWidth - 16) ) { TI.height = TI.height * ((t.wWidth - 16) / TI.width); TI.width = t.wWidth - 16; resized = 1; } T.style.width = (TI.width - 4) + 'px'; } maxHeight = t.Top + TI.height + 10; if ( maxHeight > t.pgHeight ) S.style.height = maxHeight + 'px'; window.scrollTo(0,t.Top); itop = (shHeight - TI.height) * 0.45; mtop = (itop > 3) ? Math.floor(itop) : 3; D.style.top = t.Top + mtop + 'px'; W.style.visibility = 'visible'; }, hideTags : function(arg) { var sel = document.getElementsByTagName('select'); var obj = document.getElementsByTagName('object'); var emb = document.getElementsByTagName('embed'); var ifr = document.getElementsByTagName('iframe'); var vis = ( arg ) ? 'visible' : 'hidden'; for (i = 0; i < sel.length; i++) sel[i].style.visibility = vis; for (i = 0; i < obj.length; i++) obj[i].style.visibility = vis; for (i = 0; i < emb.length; i++) emb[i].style.visibility = vis; for (i = 0; i < ifr.length; i++) ifr[i].style.visibility = vis; } }; // source --> http://www.wensleydalelodge.co.za/wp-includes/js/swfobject.js?ver=2.2-20120417 /* SWFObject v2.2 is released under the MIT License */ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab